package com.example.football.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBCUtils {

    public static String ip = "10.137.141.113";
//    public static String ip = "192.168.227.202";


//    private static final String TAG = "mysql-buwan-JDBCUtils";

//    private static String driver = "com.mysql.jdbc.Driver";// MySql驱动
//
//    private static String dbName = "buwan";// 数据库名称
//
//    private static String user = "root";// 用户名
//
//    private static String password = "010719";// 密码
//
//    public static Connection getConn(){
//
//        Connection connection = null;
//        try{
//            Class.forName(driver);// 动态加载类
//            String ip = "10.137.221.189";// 写成本机地址，不能写成localhost，同时手机和电脑连接的网络必须是同一个
////            String url = "jdbc:mysql://localhost:3306/ssmdemo?useSSL=false&serverTimezone=UTC";
//            // 尝试建立到给定数据库URL的连接
//            connection = DriverManager.getConnection("jdbc:mysql://" + ip + ":3306/" + dbName, user, password);
//
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return connection;
//    }

}

